package
{	
	import flash.display.Sprite;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;

	import com.tweenman.ConstantEase;

	public class TweenManDemo4 extends Sprite
	{
		public var mc:MovieClip;
		private var _positionEase:ConstantEase;
		
		public function TweenManDemo4 ()
		{
			this.stage.scaleMode = "noScale";
			this.stage.addEventListener(MouseEvent.MOUSE_MOVE, this._mouseMoveInit);
		}
		
		private function _mouseMoveInit (e:Event):void
		{
			e.target.removeEventListener(e.type, this._mouseMoveInit);
			this.addEventListener(Event.ENTER_FRAME, this._enterFrameHandler);
			this._positionEase = new ConstantEase(mc, ConstantEase.ELASTIC, { easeKinetic: 0.2 });
			this._enterFrameHandler();
		}
		
		private function _enterFrameHandler (e:Event=null):void
		{
			this._positionEase.setProperties({ x: this.mouseX, y: this.mouseY });
		}
	}
}